package com.atguigu.gmall.feignclients.product;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.item.vo.CategoryView;
import com.atguigu.gmall.item.vo.SkuDetailVo;
import com.atguigu.gmall.product.entity.SkuImage;
import com.atguigu.gmall.product.entity.SkuInfo;
import com.atguigu.gmall.product.entity.SpuSaleAttr;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.List;

@FeignClient("service-product")
@RequestMapping("/api/inner/rpc/product")
public interface SkuFeignClient {

    @GetMapping("/sku/detail/{skuId}")
    Result<SkuDetailVo> getSkuDetail(@PathVariable("skuId") Long skuId);

    @GetMapping("/skuinfo/{skuId}")
    Result<SkuInfo> getSkuInfo(@PathVariable("skuId") Long skuId);

    @GetMapping("/skuinfo/images/{skuId}")
    Result<List<SkuImage>> getSkuImages(@PathVariable("skuId")Long skuId);

    @GetMapping("/skuinfo/spu/saleattrandvalue/{spuId}")
    Result<List<SpuSaleAttr>> getSpuSaleAttr(@PathVariable("spuId") Long spuId, @RequestParam("skuId") Long skuId);

    @GetMapping("/skuinfo/categoryview/{c3Id}")
    Result<CategoryView> getSkuCategoryView(@PathVariable("c3Id")Long c3Id);

    @GetMapping("skuinfo/valuejson/{spuId}")
    Result<String> getSkuValueJson(@PathVariable("spuId")Long spuId);

    @GetMapping("skuinfo/price/{skuId}")
    Result<BigDecimal> getSkuPrice(@PathVariable("skuId")Long skuId);
}
